package model

import (
	"enjoy_xxz/internal/model/database/mysql"
	goods2 "enjoy_xxz/internal/model/goods"
	order2 "enjoy_xxz/internal/model/order"
	"enjoy_xxz/internal/model/spikes"
	user2 "enjoy_xxz/internal/model/user"
	"gorm.io/gorm"
)

func AutoMigration() error {
	return mysql.WithMysql(func(db *gorm.DB) error {
		return db.AutoMigrate(
			&user2.User{},
			&user2.UserAddress{},
			&goods2.Goods{},
			&goods2.GoodsProperty{},
			&goods2.GoodsPropertyValue{},
			&goods2.GoodsSku{},
			&goods2.GoodsCategory{},
			&order2.Order{},
			&order2.OrderGoods{},
			&spikes.SpikesActivity{},
			&spikes.SpikesGoodsSku{},
			&Cart{},
		)
	})
}
